package ru.jetsoft.reg112.desktop.control;

import extfx.scene.control.DatePicker;
import java.text.SimpleDateFormat;
import java.util.Locale;
import ru.jetsoft.reg112.desktop.data.Param;

public class DateControl extends InputParamControl {

    public DatePicker datePicker;

    public DateControl(Param param) {
        super(param);
        datePicker = new DatePicker(new Locale("ru","RU"));
        datePicker.setDateFormat(new SimpleDateFormat("dd.MM.yyyy"));
        datePicker.setPromptText(param.getTooltip());
        getHBox().getChildren().add(datePicker);
    }

    @Override
    public String getValue() {
        return datePicker.toString();
    }
}
